package com.lx.boot.web.convert.serializer;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lx.annotation.Note;
import com.lx.boot.web.convert.DFunction;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;

@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD,ElementType.TYPE,ElementType.PARAMETER})
@Documented
@JacksonAnnotationsInside
@JsonSerialize(using = SerializerHandler.class)
@Note("处理json序列化, 出参时转换")
public @interface Serializer {
    @Note("根据函数获取返回值! 示例:")
    Class<? extends Annotation> value() default Serializer.class;

    @Note("根据函数获取返回值! 示例:")
    Class<? extends DFunction<SerializerPara,? extends Annotation,? extends  Object>> function();

    @Note("转换的实际参数")
    String mapper() default "";

    @Note("其他自定义参数")
    String[] other() default {};


}